package dao

import (
	"github.com/jinzhu/gorm"
	_ "github.com/jinzhu/gorm/dialects/mysql"
)

var DB *gorm.DB

func InitMySql() (err error) {
	dsn := "root:123456@tcp(139.196.86.70:3306)/db_gin_vue?charset=utf8mb4&parseTime=True&loc=Local"
	DB, err = gorm.Open("mysql", dsn)
	if err != nil {
		panic(err)
	}

	return DB.DB().Ping()
}
